
<%@ page import="comptadub.Paiement" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title><g:message code="paiement.edit.label" /></title>
    </head>
    
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="paiement.list.label" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="paiement.new.label" /></g:link></span>
        </div>
      
        <div class="body">
            <h1><g:message code="paiement.edit.label" /></h1>

            <g:if test="${flash.message}">
                <div class="message">${flash.message}</div>
            </g:if>

            <g:hasErrors bean="${paiementInstance}">
            <div class="errors">
                <g:renderErrors bean="${paiementInstance}" as="list" />
            </div>
            </g:hasErrors>

            <g:form method="post" >
                <g:hiddenField name="id" value="${paiementInstance?.id}" />
                <g:hiddenField name="version" value="${paiementInstance?.version}" />
                
                <div class="dialog">
                    <table>
                        <tbody>                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="credit"><g:message code="paiement.credit.label" default="Montant" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: paiementInstance, field: 'credit', 'errors')}">
                                    <g:textField name="credit" value="${fieldValue(bean: paiementInstance, field: 'credit')}" />
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="date"><g:message code="paiement.date.label" default="Date" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: paiementInstance, field: 'date', 'errors')}">
                                    <g:datePicker name="date" precision="day" value="${paiementInstance?.date}"  />
                                </td>
                            </tr>

                            <g:if test="${session?.typeMembre == 'admin'}">
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="membre"><g:message code="paiement.membre.label" default="Membre" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: paiementInstance, field: 'membre', 'errors')}">
                                    <g:select name="membre.id" from="${comptadub.Membre.list()}" optionKey="id" optionValue="nom" value="${paiementInstance?.membre?.id}"  />
                                </td>
                            </tr>
                            </g:if>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="type"><g:message code="paiement.type.label" default="Type" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: paiementInstance, field: 'type', 'errors')}">
                                    <g:select name="type.id" from="${comptadub.TypePaiement.list()}" optionKey="id" optionValue="nom" value="${paiementInstance?.type?.id}"  />
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="commentaire"><g:message code="paiement.commentaire.label" default="Commentaire" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: paiementInstance, field: 'commentaire', 'errors')}">
                                    <g:textArea name="commentaire" cols="40" rows="5" value="${paiementInstance?.commentaire}" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
